import request from '@/utils/request'

/**
 * 获取分页客户列表
 * @returns {Promise<PageDTO<CustomerVO>} 返回分页客户数据
 */
export function getCustomerList(params) {
  return request({
    url: '/customer/list',
    method: 'get',
    params
  })
}

/**
 * 添加客户
 */
export function addCustomer(data) {
  return request({
    url: '/customer',
    method: 'post',
    data
  })
}

/**
 * 修改客户
 */
export function updateCustomer(data) {
  return request({
    url: '/customer',
    method: 'put',
    data
  })
}

/**
 * 删除客户
 */
export function deleteCustomers(ids) {
  return request({
    url: '/customer',
    method: 'delete',
    data: ids
  })
}

// 导出
export default {
  getCustomerList,
  addCustomer,
  updateCustomer
}